﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tanmia.Basis.ServiceInterface;
using Microsoft.Practices.Prism.Events;
using Tanmia.Basis.Security;

namespace Tanmia.Basis.Concretes
{
    public class NavigationService : INavigationService
    {
        private readonly IEventAggregator eventAggregator;

        public NavigationService(IEventAggregator eventAggregator)
        {
            this.eventAggregator = eventAggregator;
        }

        #region INavigationService Members

        public void RegisterNavigatorItem(NavigationItem moduleNavigationItem)
        {
            if (moduleNavigationItem == null)
                throw new ArgumentNullException("moduleNavigationItem");

            eventAggregator.GetEvent<NavigationItemAddedEvent>().Publish(moduleNavigationItem);
        }

        #endregion
    }
}
